home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 May: Tool Chest / Developer CD Series May 1996 (Tool Chest) (Apple Computer) (1996).iso / Tool Chest / Interfaces & Libraries / Interfaces / AIncludes / PPCToolbox.a < prev    next >
Encoding:
Text File  |  1993-11-30  |  11.7 KB  |  389 lines  |  [TEXT/MPS ]

  1. ;    File:        PPCToolbox.a
  2. ;
  3. ;    Copyright:    © 1983-1993 by Apple Computer, Inc.
  4. ;                All rights reserved.
  5. ;
  6. ;    Version:    System 7.1 for ETO #11
  7. ;    Created:    Tuesday, March 30, 1993 18:00
  8. ;
  9. ;___________________________________________________________________________
  10.  
  11.     IF &TYPE('__INCLUDINGPPCTOOLBOX__') = 'UNDEFINED' THEN
  12. __INCLUDINGPPCTOOLBOX__    SET    1
  13.  
  14. ;  PPCCommand Values
  15.  
  16. ;    Trap Selector D0 Must be set to one of the following, csCode will contain this value
  17. ;    when the call completes.
  18.  
  19. ppcInitCmd            EQU            0
  20. ppcOpenCmd            EQU         1
  21. ppcStartCmd           EQU         2
  22. ppcInformCmd          EQU         3
  23. ppcAcceptCmd          EQU         4
  24. ppcRejectCmd          EQU         5
  25. ppcWriteCmd           EQU         6
  26. ppcReadCmd            EQU         7
  27. ppcEndCmd             EQU         8
  28. ppcCloseCmd           EQU         9
  29. IPCListPortsCmd        EQU         10
  30.  
  31. DeleteUserCmd        EQU         12
  32. GetDefaultUserCmd    EQU         13
  33. StartSecureCmd        EQU         14
  34.  
  35. ;    Valid PPCServiceTypes
  36. ppcServiceRealTime    EQU            1
  37.  
  38.  
  39. ;    Valid PPCLocationKinds    =    Integer;
  40. ppcNoLocation        EQU            0 ;    There is no PPCLocName
  41. ppcNBPLocation        EQU            1 ;    Use AppleTalk NBP
  42. ppcNBPTypeLocation    EQU            2 ;    Use just the NBP type, fill in rest with default
  43.  
  44. ;    Valid PPCPortKinds        =    Integer;
  45. ppcByCreatorAndType    EQU            1 ;    Port type is specified as colloquial Mac creator and type
  46. ppcByString         EQU            2 ;    Port type is in pascal string format
  47.  
  48. ;    Valid PPCSessionOrigins    =    SignedByte;    { requestType returned in PPCInform }
  49. ppcLocalOrigin        EQU            1 ;    session originated from this machine
  50. ppcRemoteOrigin        EQU            2 ;    session originated from remote machine
  51.  
  52. PPCPortRec            RECORD    0 ;        TYPE                Comment
  53. nameScript            DS.W    1 ;        ScriptCode;            script of name
  54. name                DS.B    34 ;        Str32;                name of port as seen in browser
  55. portKindSelector    DS.W    1 ;        PPCPortKinds;        which variant
  56. portTypeStr            DS.B    34 ;        Str32;
  57.                     ORG portTypeStr
  58. portCreator            DS.L    1 ;        OSType;
  59. portType            DS.L    1 ;        OSType;
  60.                     ENDR
  61.  
  62. LocationNameRec    RECORD        0 ;
  63. locationKindSelector    DS.W    1 ;    PPCLocationKind;    which variant
  64. nbpEntity                DS.B     100 ;                    NBP name entity
  65.                         ORG nbpEntity ;
  66. nbpType                    DS.B    34 ;    Str32;                just the NBP type string, for PPCOpen
  67.                         ENDR
  68.  
  69.  
  70. PortInfoRec            RECORD    0 ;
  71. filler1                DS.B    1 ;    SignedByte;
  72. authRequired        DS.B    1 ;    Boolean;
  73. name                DS PPCPortRec ;
  74.                     ENDR
  75.                     
  76.                     
  77. PPCOpenPBRec     RECORD    0 ;        TYPE                Comment
  78. qLink            DS.L    1 ;        Ptr                    reserved
  79. csCode            DS.W    1 ;        INTEGER                reserved
  80. intUse            DS.W    1 ;        INTEGER                reserved
  81. intUsePtr        DS.L    1 ;        Ptr                    reserved
  82. ioCompletion    DS.L    1 ;        PPCComProcPtr        Completion routine.
  83. ioResult        DS.W    1 ;        OSErr                Result of operation.
  84. reserved        DS.L    5 ;        LONGINT                reserved
  85. portRefNum        DS.W    1 ;        PPCPortRefNum        Port Reference            
  86. filler1            DS.L    1 ;        LONGINT                ignored            
  87. serviceType        DS.B    1 ;         PPCServiceType        Bit field describing the requested port service
  88. resFlag            DS.B    1 ;        BYTE                Must be set to 0
  89. portName        DS.L    1 ;        PPCPortPtr            PortName for PPC
  90. locationName    DS.L    1 ;        LocationNamePtr        If NBP  Registration is required
  91. networkVisible    DS.B    1 ;         BOOLEAN                make this network visible on network
  92. nbpRegistered    DS.B    1 ;         BOOLEAN                The given location name was registered on the network
  93.                 ENDR
  94.  
  95.  
  96. PPCInformPBRec    RECORD    0 ;        TYPE                Comment
  97. qLink            DS.L    1 ;        Ptr                    reserved
  98. csCode            DS.W    1 ;        INTEGER                reserved
  99. intUse            DS.W    1 ;        INTEGER                reserved
  100. intUsePtr        DS.L    1 ;        Ptr                    reserved
  101. ioCompletion    DS.L    1 ;        PPCComProcPtr        Completion routine.
  102. ioResult        DS.W    1 ;        OSErr                Result of operation.
  103. reserved        DS.L    5 ;        LONGINT                reserved
  104. portRefNum         DS.W    1 ;        PPCPortRefNum        Port Identifier
  105. sessRefNum        DS.L    1 ;        PPCSessRefNum        Session Reference
  106. serviceType        DS.B    1 ;        PPCServiceType        Status Flags for type of session, local, remote
  107. autoAccept         DS.B    1 ;        Boolean                if true session will be accepted automatically
  108. portName        DS.L    1 ;        PPCPortPtr            Buffer for Source PPCPortRec
  109. locationName    DS.L    1 ;        LocationNamePtr        Buffer for Source LocationNameRec
  110. userName        DS.L    1 ;        StringPtr            Buffer for Soure user's name trying to link.
  111. userData        DS.L    1 ;        LongInt                value included in PPCStart's userData
  112. requestType        DS.B    1 ;        PPCSessionOrigin    Local or Network
  113.                 ENDR
  114.  
  115.  
  116. PPCStartPBRec    RECORD    0 ;        TYPE                Comment
  117. qLink            DS.L    1 ;        Ptr                    reserved
  118. csCode            DS.W    1 ;        INTEGER                reserved
  119. intUse            DS.W    1 ;        INTEGER                reserved
  120. intUsePtr        DS.L    1 ;        Ptr                    reserved
  121. ioCompletion    DS.L    1 ;        PPCComProcPtr        Completion routine.
  122. ioResult        DS.W    1 ;        OSErr                Result of operation.
  123. reserved        DS.L    5 ;        LONGINT                reserved
  124. portRefNum:     DS.W    1 ;        PPCPortRefNum;        Port Identifier
  125. sessRefNum:        DS.L    1 ;        PPCSessRefNum;        Session Reference
  126. serviceType:    DS.B    1 ;        PPCServiceType        Actual service method (realTime)
  127. resFlag:         DS.B    1 ;        SignedByte            Must be set to 0
  128. portName:        DS.L    1 ;        PPCPortPtr            Destination portName
  129. locationName:    DS.L    1 ;        LocationNamePtr        NBP or NAS style service location name
  130. rejectInfo:        DS.L    1 ;        LongInt                reason for rejecting the session request
  131. userData:        DS.L    1 ;        LongInt                Copied to destination PPCInform parameter block
  132. userRefNum:        DS.L    1 ;        LongInt                userRefNum (obtained during login process)
  133.                 ENDR
  134.  
  135.  
  136. PPCAcceptPBRec    RECORD    0 ;        TYPE                Comment
  137. qLink            DS.L    1 ;        Ptr                    reserved
  138. csCode            DS.W    1 ;        INTEGER                reserved
  139. intUse            DS.W    1 ;        INTEGER                reserved
  140. intUsePtr        DS.L    1 ;        Ptr                    reserved
  141. ioCompletion    DS.L    1 ;        PPCComProcPtr        Completion routine.
  142. ioResult        DS.W    1 ;        OSErr                Result of operation.
  143. reserved        DS.L    5 ;        LONGINT                reserved
  144. filler1            DS.W    1 ;         Integer                    
  145. sessRefNum        DS.L    1 ;        PPCSessRefNum        Session Reference
  146.                 ENDR
  147.                         
  148.                         
  149. PPCRejectPBRec    RECORD    0 ;        TYPE                Comment
  150. qLink            DS.L    1 ;        Ptr                    reserved
  151. csCode            DS.W    1 ;        INTEGER                reserved
  152. intUse            DS.W    1 ;        INTEGER                reserved
  153. intUsePtr        DS.L    1 ;        Ptr                    reserved
  154. ioCompletion    DS.L    1 ;        PPCComProcPtr        Completion routine.
  155. ioResult        DS.W    1 ;        OSErr                Result of operation.
  156. reserved        DS.L    5 ;        LONGINT                reserved
  157. filler1            DS.W    1 ;         Integer
  158. sessRefNum        DS.L    1 ;        PPCSessRefNum        Session Reference
  159. filler2            DS.W    1 ;        Integer
  160. filler3            DS.L    1 ;        LongInt
  161. filler4            DS.L    1 ;        LongInt
  162. rejectInfo        DS.L    1 ;        LongInt                reason for rejecting the session request
  163.                 ENDR
  164.     
  165.     
  166. PPCWritePBRec    RECORD    0 ;        TYPE                Comment
  167. qLink            DS.L    1 ;        Ptr                    reserved
  168. csCode            DS.W    1 ;        INTEGER                reserved
  169. intUse            DS.W    1 ;        INTEGER                reserved
  170. intUsePtr        DS.L    1 ;        Ptr                    reserved
  171. ioCompletion    DS.L    1 ;        PPCComProcPtr        Completion routine.
  172. ioResult        DS.W    1 ;        OSErr                Result of operation.
  173. reserved        DS.L    5 ;        LONGINT                reserved
  174. filler1            DS.W    1 ;        Integer
  175. sessRefNum        DS.L    1 ;        PPCSessRefNum        Session Reference
  176. bufferLength    DS.L    1 ;        Size                Length of the message buffer
  177. actualLength    DS.L    1 ;        Size                Actual Length Written
  178. bufferPtr        DS.L    1 ;        Ptr                    Pointer to message buffer
  179. more            DS.B    1 ;        Boolean                if more data in this block will be written    
  180. filler2            DS.B    1 ;        SignedByte;                 
  181. userData        DS.L    1 ;        LongInt                Message block userData Uninterpreted by PPC    
  182. blockCreator    DS.L    1 ;        OSType                Message block creator Uninterpreted by PPC    
  183. blockType        DS.L    1 ;        OSType                Message block type Uninterpreted by PPC    
  184.                 ENDR
  185.     
  186.     
  187. PPCReadPBRec    RECORD    0 ;        TYPE                Comment
  188. qLink            DS.L    1 ;        Ptr                    reserved
  189. csCode            DS.W    1 ;        INTEGER                reserved
  190. intUse            DS.W    1 ;        INTEGER                reserved
  191. intUsePtr        DS.L    1 ;        Ptr                    reserved
  192. ioCompletion    DS.L    1 ;        PPCComProcPtr        Completion routine.
  193. ioResult        DS.W    1 ;        OSErr                Result of operation.
  194. reserved        DS.L    5 ;        LONGINT                reserved
  195. filler1            DS.W    1 ;        Integer
  196. sessRefNum        DS.L    1 ;        PPCSessRefNum        Session Reference
  197. bufferLength    DS.L    1 ;        Size                Length of the message buffer
  198. actualLength    DS.L    1 ;        Size                Actual length read
  199. bufferPtr        DS.L    1 ;        Ptr                    Pointer to message buffer
  200. more            DS.B    1 ;        Boolean                if true more data in this block to be read
  201. filler2            DS.B    1 ;        SignedByte
  202. userData        DS.L    1 ;        LongInt                Message block userData Uninterpreted by PPC
  203. blockCreator    DS.L    1 ;        OSType                Message block creator Uninterpreted by PPC
  204. blockType        DS.L    1 ;        OSType                Message block type Uninterpreted by PPC
  205.                 ENDR
  206.     
  207.     
  208. PPCEndPBRec        RECORD    0 ;        TYPE                Comment
  209. qLink            DS.L    1 ;        Ptr                    reserved
  210. csCode            DS.W    1 ;        INTEGER                reserved
  211. intUse            DS.W    1 ;        INTEGER                reserved
  212. intUsePtr        DS.L    1 ;        Ptr                    reserved
  213. ioCompletion    DS.L    1 ;        PPCComProcPtr        Completion routine.
  214. ioResult        DS.W    1 ;        OSErr                Result of operation.
  215. reserved        DS.L    5 ;        LONGINT                reserved
  216. filler1            DS.W    1 ;        Integer                    
  217. sessRefNum        DS.L    1 ;        PPCSessRefNum        Session Reference
  218.                 ENDR
  219.     
  220.     
  221. PPCClosePBRec    RECORD    0 ;        TYPE                Comment
  222. qLink            DS.L    1 ;        Ptr                    reserved
  223. csCode            DS.W    1 ;        INTEGER                reserved
  224. intUse            DS.W    1 ;        INTEGER                reserved
  225. intUsePtr        DS.L    1 ;        Ptr                    reserved
  226. ioCompletion    DS.L    1 ;        PPCComProcPtr        Completion routine.
  227. ioResult        DS.W    1 ;        OSErr                Result of operation.
  228. reserved        DS.L    5 ;        LONGINT                reserved
  229. portRefNum        DS.W    1 ;         PPCPortRefNum        Port Identifier
  230.                 ENDR
  231.     
  232.     
  233. IPCListPortsPBRec    RECORD    0 ;    TYPE                Comment
  234. qLink            DS.L    1 ;        Ptr                    reserved
  235. csCode            DS.W    1 ;        INTEGER                reserved
  236. intUse            DS.W    1 ;        INTEGER                reserved
  237. intUsePtr        DS.L    1 ;        Ptr                    reserved
  238. ioCompletion    DS.L    1 ;        PPCComProcPtr        Completion routine.
  239. ioResult        DS.W    1 ;        OSErr                Result of operation.
  240. reserved        DS.L    5 ;        LONGINT                reserved
  241. filler1            DS.W    1 ;        Integer
  242. startIndex        DS.W    1 ;         Integer                Start Index
  243. requestCount    DS.W    1 ;        Integer                Number of entries to be returned
  244. actualCount        DS.W    1 ;        Integer                Actual Number of entries to be returned
  245. portName        DS.L    1 ;        PPCPortPtr            PortName Match
  246. locationName    DS.L    1 ;        LocationNamePtr        NBP or NAS type name to locate the Port Location
  247. bufferPtr        DS.L    1 ;        PortInfoArrayPtr    Pointer to a buffer requestCount*sizeof(PortInfo) bytes big                            
  248.                 ENDR
  249.     
  250. DeleteUserParams    RECORD     0 ;
  251. userRefNum        DS.L    1 ;        LONGINT
  252.                 ENDR
  253.  
  254. StartSecureParams    RECORD    0 ;    TYPE
  255. prompt            DS.L    1 ;        StringPtr
  256. guestSelected    DS.L    1 ;        pointer to a Boolean
  257. allowGuest        DS.B    1 ;        Boolean
  258. reserved1        DS.B    1 ;        Byte
  259. useDefault        DS.B    1 ;        Boolean
  260. reserved2        DS.B    1 ;        Byte
  261. userName        DS.L    1 ;        StringPtr
  262. startPb            DS.L    1 ;        PPCStartPBPtr
  263.                 ENDR
  264.  
  265. GetDefaultUserParams    RECORD    0 ;
  266. userName        DS.L    1 ;        Pointer to Str32.
  267. userRef            DS.L    1 ;        Pointer to LONGINT.
  268.                 ENDR
  269.  
  270. PPCParamBlockRec    RECORD    0 ;
  271. openParam        DS    PPCOpenPBRec
  272.                 ORG 0
  273. informParam        DS    PPCInformPBRec
  274.                 ORG 0
  275. startParam        DS    PPCStartPBRec
  276.                 ORG 0
  277. acceptParam        DS    PPCAcceptPBRec
  278.                 ORG 0
  279. rejectParam        DS    PPCRejectPBRec
  280.                 ORG 0
  281. writeParam        DS    PPCWritePBRec
  282.                 ORG 0
  283. readParam         DS    PPCReadPBRec
  284.                 ORG 0
  285. endParam        DS    PPCEndPBRec
  286.                 ORG 0
  287. closeParam        DS    PPCClosePBRec
  288.                 ORG 0
  289. listPortsParam    DS    IPCListPortsPBRec
  290.                 ENDR
  291.  
  292.  
  293.  
  294.                   Macro
  295.                   _PPCInit
  296.                   MOVEQ       #ppcInitCmd,D0
  297.                   DC.W        $A0DD
  298.                   Endm
  299.  
  300.                   Macro
  301.                   _DoPPCTrap
  302.                   IF          &SYSLIST[1] = 'SYNC' THEN
  303.                   DC.W        $A0DD
  304.                   ELSE
  305.                   DC.W        $A4DD
  306.                   ENDIF
  307.                   Endm
  308.  
  309.                   Macro
  310.                   _PPCMacro
  311.                   MOVEQ       &SYSLIST[1],D0
  312.                   _DoPPCTrap &SYSLIST[2] 
  313.                   Endm
  314.  
  315.                   Macro
  316.                   _PPCOpen
  317.                   _PPCMacro   #ppcOpenCmd,&SYSLIST[2]
  318.                   Endm
  319.  
  320.                   Macro
  321.                   _PPCInform
  322.                   _PPCMacro   #ppcInformCmd,&SYSLIST[2]
  323.                   Endm
  324.  
  325.                   Macro
  326.                   _PPCStart
  327.                   _PPCMacro   #ppcStartCmd,&SYSLIST[2]
  328.                   Endm
  329.  
  330.                   Macro
  331.                   _PPCAccept
  332.                   _PPCMacro   #ppcAcceptCmd,&SYSLIST[2]
  333.                   Endm
  334.  
  335.                   Macro
  336.                   _PPCReject
  337.                   _PPCMacro   #ppcRejectCmd,&SYSLIST[2]
  338.                   Endm
  339.  
  340.                   Macro
  341.                   _PPCWrite
  342.                   _PPCMacro   #ppcWriteCmd,&SYSLIST[2]
  343.                   Endm
  344.  
  345.                   Macro
  346.                   _PPCRead
  347.                   _PPCMacro   #ppcReadCmd,&SYSLIST[2]
  348.                   Endm
  349.  
  350.                   Macro
  351.                   _PPCClose
  352.                   _PPCMacro   #ppcCloseCmd,&SYSLIST[2]
  353.                   Endm
  354.  
  355.                   Macro
  356.                   _PPCEnd
  357.                   _PPCMacro   #ppcEndCmd,&SYSLIST[2]
  358.                   Endm
  359.  
  360.                   Macro
  361.                   _IPCListPorts
  362.                   _PPCMacro   #IPCListPortsCmd,&SYSLIST[2]
  363.                   Endm
  364.                 
  365.                 Macro
  366.                 _DeleteUserIdentity
  367.                 Moveq    #DeleteUserCmd,D0
  368.                 DC.W    $A0DD
  369.                 Endm
  370.                 
  371.                 Macro
  372.                 _GetDefaultUser
  373.                 Moveq    #GetDefaultUserCmd,D0
  374.                 DC.W    $A0DD
  375.                 Endm
  376.  
  377.                 Macro
  378.                 _StartSecureSession
  379.                 Moveq    #StartSecureCmd,D0
  380.                 DC.W    $A0DD
  381.                 Endm
  382.  
  383.                 Macro
  384.                 _PPCBrowser
  385.                 MOVE.W        #$0D00,D0
  386.                 _Pack9
  387.                   Endm
  388.  
  389.     ENDIF     ;...already included